<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/common/default.jsp"%>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<script type="text/javascript" src="${ctx}/static/tools/jquery-validationEngine/jquery.validationEngine.js"></script>
		<script type="text/javascript" src="${ctx}/static/tools/jquery-validationEngine/jquery.validationEngine-cn.js"></script>
	</head>
	

	<body>
		<div class="breadcrumbs" id="breadcrumbs">
			<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>
	
			<ul class="breadcrumb">
				<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
				<li>订单管理</li>
				<li class="active">购买记录</li>
			</ul>
			<!-- .breadcrumb -->
		</div>	
		
		<div class="page-content">
			<div class="page-header">
				<h1>订单管理
					<small>
					<i class="icon-double-angle-right"></i>
					购买记录
					</small>					
				</h1>			
			</div>
			<div>
				<form  id="searchForm" name="searchForm" role="form" method="post" action="${ctx}/sys/tpurchaseRecord/list">
				<input type="text" id="studentname" name="studentname" placeholder="学生姓名" value="${searchForm.studentname}" class="col-xs-10 col-sm-2"/>
				<input type="text" id="orderCode" name="orderCode" placeholder="订单编号" value="${searchForm.orderCode}" class="col-xs-10 col-sm-2"/>
					<label for="form-field-select-3" style="width:40px;margin-left: 20px" for="subjectId">科目 </label>
					<select  id="subjectId" name="subjectId" data-placeholder="请选择科目">
						<option value="">请选择科目</option>
						<option value="1"  <c:if test="${searchForm.subjectId eq '1'}">selected</c:if> >语文</option>
						<option value="2" <c:if test="${searchForm.subjectId eq '2'}">selected</c:if> >数学</option>
						<option value="3" <c:if test="${searchForm.subjectId eq '3'}">selected</c:if> >英语</option>
					</select>
					<input id="sysUserInfoSearch" type="submit" value="查询" style="margin-left: 10px">
					
				</form>				
			</div>
				
			<div style="line-height: 10px;">&nbsp;</div> 
		
			<div class="row" >	
			<div class="col-xs-12">
				<table id="simple-table" class="table table-striped table-bordered table-hover"  style="margin-top:5px;">
							<thead>
								<tr>
									
									<th class='center' style="width:50px;">序号</th>
									<th class="center">学生</th>
									<th class="center">订单号</th>
									<th class="center">科目</th>
									<th class="center">支付金额</th>
									<th class="center">购买时间</th>
								</tr>
							</thead>
												
							<tbody id="userlist">
							<c:forEach var="res" items="${res.data.rows}" varStatus="status">
							<tr id="userinfo_row_${res.id}" >
								<td class='center' >${status.index+1}</td>
								<td class="center">&nbsp;${res.studentName}</td>  							
								<td class="center">&nbsp;${res.orderCode}</td>
								<td class="center" title="${res.subjectName}">&nbsp;${res.subjectName}</td>
								<td class="center" title="${res.orderPrice}">&nbsp;${res.orderPrice}</td>
								<td class="center" title="${res.orderPrice}">&nbsp;<fmt:formatDate value="${res.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
							</tr> 
							</c:forEach>
							</tbody>
				</table>
				
				<%@ include file="/WEB-INF/views/decorators/page.jsp"%> 	 
			</div>
			</div>
			
			
		</div>
		<script type="text/javascript">
			jQuery(function($) {
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
				
				/* $('.date-picker').datepicker({autoclose:true}).next().on(ace.click_event, function(){
					$(this).prev().focus();
				}); */
			})
			
		
		</script>
	</body>

</html>
